package com.li.controller;

import com.li.pojo.dto.ClueDTO;
import com.li.pojo.po.Clue;
import com.li.pojo.po.Opportunities;
import com.li.pojo.po.PageResult;
import com.li.pojo.po.Result;
import com.li.service.ClueRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("/clues/record")
@RestController
public class ClueRecordController {
    @Autowired
    private ClueRecordService clueRecordService;

    @GetMapping("/list")
    public PageResult recordList(@RequestParam("clueId") Long id,
                                @RequestParam(defaultValue = "1") Integer pageIndex,
                                 @RequestParam(defaultValue = "10") Integer pageSize){
        PageResult pageResult = clueRecordService.recordList(id,pageSize,pageIndex);
        return pageResult;
    }

    @PostMapping
    public Result recordAdd(@RequestBody Clue clue){
//        log.info("{}",opportunities);
        clueRecordService.recordAdd(clue);
        return Result.success();
    }

}
